package com.cci.kangdao.common;

/**
 * @author William Du
 * @date 2019/4/4
 */
public class RedisKeys {

    public static final String tokenKey(String token){
        return String.format("%s-%s-%s","User","tokenKey",token);
    }

    public static final String managementTokenKey(String webClientId){
        return String.format("%s-%s","managementTokenKey",webClientId);
    }

    public static final String tokenCallLogKey(String adUserId){
        return String.format("%s-%s","tokenCallLogKey",adUserId);
    }

    public static final String refreshingTokenKey(String token){
        return String.format("%s-%s-%s","User","refreshingTokenKey",token);
    }

    public static final String overTimeWorkOrderTypeKey(String workOrderId,Integer code){
        return String.format("%s-%s-%d","overTimeWorkOrderTypeKey",workOrderId,code);
    }

    public static final String workOrderNoKey(String date){
        return String.format("%s-%s","workOrderNoKey",date);
    }
    
    
    public static final String applyRecordNoKey(String date){
        return String.format("%s-%s","applyRecordNoKey",date);
    }

    public static final String geTuiKey(){
        return "getui";
    }

    public static final String dbuWorkOrderScheduledKey(){
        return "dbuWorkOrderScheduledKey";
    }

    public static final String workOrderReasonKey(Integer type){
        return String.format("%s-%d","workOrderReasonKey",type);
    }

    public static final String getGDCallCounts(String time){
        return String.format("%s-%s","getGDCallCounts",time);
    }

    public static final String fieldServiceItemNoKey(String date){
        return String.format("%s-%s","fieldServiceItemNoKey",date);
    }

    public static final String fieldServiceOrderNoKey(String date){
        return String.format("%s-%s","fieldServiceOrderNoKey",date);
    }

    public static final String fieldServiceInvestigationNoKey(String date){
        return String.format("%s-%s","fieldServiceInvestigationNoKey",date);
    }

    public static final String fieldSyncMapKey(){
        return String.format("%s","fieldSyncMapKey");
    }

    public static final String fieldSyncLockKey(String itemId){
        return String.format("%s-%s","fieldSyncLockKey",itemId);
    }


    public static final String getRemindKey(){
        return "RemindStatus";
    }

    public static String escalationNoKey(String strDate) {
        return String.format("%s-%s","escalationOrderNoKey",strDate);
    }

    public static final String getRemindStatusForEscalation(){
        return "EscalationRemindStatus";
    }

    public static final String pictureNoKey(Long orderId,Long categoryId){
        return String.format("%s-%s-%s","pictureNoKey",String.valueOf(orderId),String.valueOf(categoryId));
    }

    public static final String dbuStartRepairTime(Long orderId){
        return String.format("%s-%s","dbuStartRepairTime",String.valueOf(orderId));
    }

    /**
     *  外部token生成逻辑
     * @param companyNo
     * @param sourceType
     * @param outSideId
     * @return
     */
    public static final String outSideToken(Long companyNo,Integer sourceType,String outSideId){
        return String.format("%s-%s-%s-%s","outSide",String.valueOf(companyNo),String.valueOf(sourceType),outSideId);
    }

    //目前一键登录生成的本地token，phone就是userName
    public static final String localTokenKey(String phone){
        return String.format("%s-%s","AKeyLogin-UserT",phone);
    }
    public static final String userKey(String userId){
        return String.format("%s%s","userT",userId);
    }


    //一键登录使用手机号验证码登录   key
    public static final String aKeyLoginCellPhoneVerifyCodeKey(String phone){
        return String.format("%s-%s","AKeyLogin-CellPhone-VerifyCode",phone);
    }
}
